home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / checkbox / plugins / user_interface.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.8 KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from checkbox.lib.iterator import Iterator
  5. from checkbox.properties import Path, String
  6. from checkbox.plugin import Plugin
  7. import gettext
  8. from gettext import gettext as _
  9.  
  10. class UserInterface(Plugin):
  11.     interface_module = String()
  12.     interface_class = String()
  13.     gettext.textdomain('checkbox')
  14.     title = String(default = _('System Testing'))
  15.     data_path = Path(required = False)
  16.     
  17.     def register(self, manager):
  18.         super(UserInterface, self).register(manager)
  19.         self._manager.reactor.call_on('run', self.run)
  20.  
  21.     
  22.     def run(self):
  23.         interface_module = __import__(self.interface_module, None, None, [
  24.             ''])
  25.         interface_class = getattr(interface_module, self.interface_class)
  26.         interface = interface_class(self.title, self.data_path)
  27.         iterator = Iterator([
  28.             'prompt-begin',
  29.             'prompt-gather',
  30.             'prompt-category',
  31.             'prompt-tests',
  32.             'prompt-report',
  33.             'prompt-exchange',
  34.             'prompt-finish'])
  35.         while True:
  36.             
  37.             try:
  38.                 event_type = iterator.go(interface.direction)
  39.             except StopIteration:
  40.                 break
  41.  
  42.             self._manager.reactor.fire(event_type, interface)
  43.  
  44.  
  45. factory = UserInterface
  46.